﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Src="~/MyControls/MyUserControl.ascx" TagPrefix="uc1" TagName="MyUserControl" %>
<%@ Register Src="~/MyControls/UserComments.ascx" TagPrefix="uc1" TagName="UserComments" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderVisitor" runat="Server">
    <p style="font-weight: 500; margin-bottom: -5px; text-transform: uppercase">Page Information:</p>
    <table style="width: 100%;">
        <tr>
            <td colspan="2" style="font-family:'Times New Roman';">
                <asp:Label ID="lblTime" runat="server" Text="time"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 85px">Visistor :</td>
            <td style="font-weight: bold; width: 57%; text-align: left;">
                <asp:Label ID="lblVisistorCount" runat="server" Text="-1"></asp:Label></td>
        </tr>
        <tr>
            <td style="width: 85px">Total News:</td>
            <td style="font-weight: bold; text-align: left; width: 57%;">
                <asp:Label ID="lblTotalNews" runat="server" Text="-1"></asp:Label></td>

        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnCreateNews" runat="server" Text="Create New" OnClick="btnCreateNews_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderSideBar" runat="Server">
    <table style="width: 100%;">
        <tr>
            <td>
                <asp:DropDownList ID="ddlChanel" runat="server" Width="100%" AutoPostBack="True" OnSelectedIndexChanged="ddlChanel_SelectedIndexChanged" CssClass="dropdownlist">
                    <asp:ListItem>Select...</asp:ListItem>
                    <asp:ListItem>World</asp:ListItem>
                    <asp:ListItem>Entertainment</asp:ListItem>
                    <asp:ListItem>Sport</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:MultiView ID="mvwChannel" runat="server">
                    <asp:View ID="vwChannelWorld" runat="server">
                        <asp:LinkButton ID="lbtnLasterWorld" runat="server" CssClass="link_button" OnClick="lbtnLasterWorld_Click">Lastest</asp:LinkButton><br />
                        <asp:LinkButton ID="lbtnMostViewWorld" runat="server" CssClass="link_button" OnClick="lbtnMostViewWorld_Click">Most Viewed</asp:LinkButton><br />
                        <asp:LinkButton ID="lbtnMostCommentWorld" runat="server" CssClass="link_button" OnClick="lbtnMostCommentWorld_Click">Most Commented</asp:LinkButton><br />
                        <br />
                        <asp:TextBox ID="txtSWorld" runat="server" Width="100%"></asp:TextBox>
                        <br />
                        <asp:RadioButtonList ID="rbtnlWorld" runat="server">
                            <asp:ListItem>Title</asp:ListItem>
                            <asp:ListItem Selected="True">Author</asp:ListItem>
                        </asp:RadioButtonList>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnSearchWorld" runat="server" Text="Search" Width="87px" OnClick="btnSearchWorld_Click" />
                    </asp:View>
                    <asp:View ID="vwChannelEntertainment" runat="server">
                        <asp:LinkButton ID="LinkButton1" runat="server" CssClass="link_button">Lastest</asp:LinkButton><br />
                        <asp:LinkButton ID="LinkButton2" runat="server" CssClass="link_button">Most Viewed</asp:LinkButton><br />
                        <asp:LinkButton ID="LinkButton3" runat="server" CssClass="link_button">Most Commented</asp:LinkButton><br />
                        <br />
                        <asp:TextBox ID="TextBox1" runat="server" Width="100%" TextMode="MultiLine" BorderColor="#f8f8f8" BorderStyle="Solid" PlaceHolder="Search by.."></asp:TextBox><br />
                        <asp:RadioButtonList ID="RadioButtonList2" runat="server">
                            <asp:ListItem>Title</asp:ListItem>
                            <asp:ListItem Selected="True">Author</asp:ListItem>
                        </asp:RadioButtonList>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="Button1" runat="server" Text="Search" Width="87px" />
                    </asp:View>
                    <asp:View ID="vwChannelSport" runat="server">
                        <asp:LinkButton ID="LinkButton4" runat="server" CssClass="link_button">Lastest</asp:LinkButton><br />
                        <asp:LinkButton ID="LinkButton5" runat="server" CssClass="link_button">Most Viewed</asp:LinkButton><br />
                        <asp:LinkButton ID="LinkButton6" runat="server" CssClass="link_button">Most Commented</asp:LinkButton><br />
                        <br />
                        <asp:TextBox ID="TextBox2" runat="server" Width="100%" TextMode="MultiLine" BorderColor="#f8f8f8" BorderStyle="Solid" PlaceHolder="Search by.."></asp:TextBox><br />
                        <asp:RadioButtonList ID="rbtnlSearchSport" runat="server">
                            <asp:ListItem>Title</asp:ListItem>
                            <asp:ListItem Selected="True">Author</asp:ListItem>
                        </asp:RadioButtonList>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="Button2" runat="server" Text="Search" Width="87px" />
                    </asp:View>
                </asp:MultiView>
            </td>
        </tr>
    </table>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderNews" runat="Server">
    <asp:MultiView ID="mvwNewsContent" runat="server" ActiveViewIndex="0">
        <asp:View ID="vwHomePage" runat="server">
            <uc1:MyUserControl runat="server" ID="WorldControl" />
            <uc1:MyUserControl runat="server" ID="EntertainmentControl" />
            <uc1:MyUserControl runat="server" ID="SportControl" />
        </asp:View>
        <asp:View ID="vwWorldPage" runat="server">
            <asp:GridView ID="gvwWorldPage" runat="server" Width="100%" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="NewsID" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Horizontal" OnSelectedIndexChanged="gvwWorldPage_SelectedIndexChanged">

                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="NewsID" HeaderText="NewsID" InsertVisible="False" ReadOnly="True" SortExpression="NewsID" />
                    <asp:BoundField DataField="ChanelName" HeaderText="ChanelName" SortExpression="ChanelName" />
                    <asp:BoundField DataField="TitleNews" HeaderText="TitleNews" SortExpression="TitleNews" />
                    <asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
                    <asp:BoundField DataField="TimePost" HeaderText="TimePost" SortExpression="TimePost" />
                    <asp:BoundField DataField="CountRead" HeaderText="CountRead" SortExpression="CountRead" />
                    <asp:BoundField DataField="CountComments" HeaderText="CountComments" SortExpression="CountComments" />
                </Columns>
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F7F7F7" />
                <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
                <SortedDescendingCellStyle BackColor="#E5E5E5" />
                <SortedDescendingHeaderStyle BackColor="#242121" />

            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ALC_NewsConnectionString %>" SelectCommand="SELECT [NewsID], [ChanelName], [TitleNews], [Author], [TimePost], [CountRead], [CountComments] FROM [New_Report] WHERE ([ChanelName] = @ChanelName)">
                <SelectParameters>
                    <asp:Parameter DefaultValue="World" Name="ChanelName" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <br />
            <asp:Panel ID="pnlWorldPage" runat="server">
                <table style="width: 100%;">
                    <tr>
                        <td>
                            <asp:Label ID="lblWorldTitle" runat="server" ForeColor="#f34c31" Font-Bold="true"></asp:Label>
                            <asp:LinkButton ID="lbtnWorldShare" runat="server" Text=">>Share new.." CssClass="link_button" OnClick="lbtnWorldShare_Click"></asp:LinkButton>
                        </td>                        
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNewWorldContent" runat="server"></asp:Label>
                        </td>
                    </tr>   
                    <tr>
                        <td>
                            <asp:Panel ID="pnlWorldComments" runat="server">

                            </asp:Panel>
                        </td>
                    </tr>                 
                </table>

            </asp:Panel>
        </asp:View>
        <asp:View ID="vwEntertainmentPage" runat="server">
            <asp:GridView ID="gvwEntertainmentPage" runat="server" Width="100%" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="NewsID" DataSourceID="SqlDataSource2" ForeColor="Black" GridLines="Horizontal">

                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="NewsID" HeaderText="NewsID" InsertVisible="False" ReadOnly="True" SortExpression="NewsID" />
                    <asp:BoundField DataField="ChanelName" HeaderText="ChanelName" SortExpression="ChanelName" />
                    <asp:BoundField DataField="TitleNews" HeaderText="TitleNews" SortExpression="TitleNews" />
                    <asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
                    <asp:BoundField DataField="TimePost" HeaderText="TimePost" SortExpression="TimePost" />
                    <asp:BoundField DataField="CountRead" HeaderText="CountRead" SortExpression="CountRead" />
                    <asp:BoundField DataField="CountComments" HeaderText="CountComments" SortExpression="CountComments" />
                </Columns>
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F7F7F7" />
                <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
                <SortedDescendingCellStyle BackColor="#E5E5E5" />
                <SortedDescendingHeaderStyle BackColor="#242121" />

            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ALC_NewsConnectionString %>" SelectCommand="SELECT [NewsID], [ChanelName], [TitleNews], [Author], [TimePost], [CountRead], [CountComments] FROM [New_Report] WHERE ([ChanelName] = @ChanelName)">

                <SelectParameters>
                    <asp:Parameter DefaultValue="Entertainment" Name="ChanelName" Type="String" />
                </SelectParameters>

            </asp:SqlDataSource>
            <br />
            <asp:Panel ID="pnlEntertainmentPage" runat="server">

            </asp:Panel>
        </asp:View>
        <asp:View ID="vwSportPage" runat="server">
            <asp:GridView ID="gvwSportPage" runat="server" Width="100%" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="NewsID" DataSourceID="SqlDataSource3" ForeColor="Black" GridLines="Horizontal">

                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="NewsID" HeaderText="NewsID" InsertVisible="False" ReadOnly="True" SortExpression="NewsID" />
                    <asp:BoundField DataField="ChanelName" HeaderText="ChanelName" SortExpression="ChanelName" />
                    <asp:BoundField DataField="TitleNews" HeaderText="TitleNews" SortExpression="TitleNews" />
                    <asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
                    <asp:BoundField DataField="TimePost" HeaderText="TimePost" SortExpression="TimePost" />
                    <asp:BoundField DataField="CountRead" HeaderText="CountRead" SortExpression="CountRead" />
                    <asp:BoundField DataField="CountComments" HeaderText="CountComments" SortExpression="CountComments" />
                </Columns>
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F7F7F7" />
                <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
                <SortedDescendingCellStyle BackColor="#E5E5E5" />
                <SortedDescendingHeaderStyle BackColor="#242121" />

            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ALC_NewsConnectionString %>" SelectCommand="SELECT [NewsID], [ChanelName], [TitleNews], [Author], [TimePost], [CountRead], [CountComments] FROM [New_Report] WHERE ([ChanelName] = @ChanelName)">

                <SelectParameters>
                    <asp:Parameter DefaultValue="Sport" Name="ChanelName" Type="String" />
                </SelectParameters>

            </asp:SqlDataSource>
            <br />
            <asp:Panel ID="pnlSportPage" runat="server">

            </asp:Panel>
        </asp:View>
        <asp:View ID="vwSearchpage" runat="server">
            <asp:GridView ID="gvwSearch" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" Width="100%" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="NewsID" DataSourceID="SqlDataSource4">
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="NewsID" HeaderText="NewsID" InsertVisible="False" ReadOnly="True" SortExpression="NewsID" />
                    <asp:BoundField DataField="ChanelName" HeaderText="ChanelName" SortExpression="ChanelName" />
                    <asp:BoundField DataField="TitleNews" HeaderText="TitleNews" SortExpression="TitleNews" />
                    <asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
                    <asp:BoundField DataField="TimePost" HeaderText="TimePost" SortExpression="TimePost" />
                    <asp:BoundField DataField="CountRead" HeaderText="CountRead" SortExpression="CountRead" />
                    <asp:BoundField DataField="CountComments" HeaderText="CountComments" SortExpression="CountComments" />
                </Columns>
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F7F7F7" />
                <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
                <SortedDescendingCellStyle BackColor="#E5E5E5" />
                <SortedDescendingHeaderStyle BackColor="#242121" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ALC_NewsConnectionString %>" SelectCommand="SELECT [NewsID], [ChanelName], [TitleNews], [Author], [TimePost], [CountRead], [CountComments] FROM [New_Report] WHERE ([ChanelName] = @ChanelName) ORDER BY [TimePost] DESC">
                <SelectParameters>
                    <asp:Parameter DefaultValue="World" Name="ChanelName" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ALC_NewsConnectionString %>" SelectCommand="SELECT [NewsID], [ChanelName], [TitleNews], [Author], [TimePost], [CountRead], [CountComments] FROM [New_Report] WHERE ([ChanelName] = @ChanelName) ORDER BY [CountRead] DESC">
                <SelectParameters>
                    <asp:Parameter DefaultValue="World" Name="ChanelName" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource6" runat="server" ConnectionString="<%$ ConnectionStrings:ALC_NewsConnectionString %>" SelectCommand="SELECT [NewsID], [ChanelName], [TitleNews], [Author], [TimePost], [CountRead], [CountComments] FROM [New_Report] WHERE ([ChanelName] = @ChanelName) ORDER BY [CountComments] DESC">
                <SelectParameters>
                    <asp:Parameter DefaultValue="World" Name="ChanelName" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <br />
            <asp:Panel ID="Panel1" runat="server">
                <table style="width: 100%;">
                    <tr>
                        <td>
                            <asp:Label ID="lblTitleNewsSearch" runat="server" ForeColor="#f34c31" Font-Bold="true"></asp:Label>
                            <asp:LinkButton ID="lbtnNewSearchShare" runat="server" Text=">>Share new.." CssClass="link_button"></asp:LinkButton>
                        </td>                        
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblTitleNewSearhContent" runat="server"></asp:Label>
                        </td>
                    </tr>   
                    <tr>
                        <td>
                            <asp:Panel ID="pnlNewsSearchComments" runat="server">

                            </asp:Panel>
                        </td>
                    </tr>                 
                </table>
            </asp:Panel>
        </asp:View>
    </asp:MultiView>

</asp:Content>

